import http from '@/utils/http'
import {
  SystemRoleAddType,
  SystemRoleListItemType,
  SystemRoleListQueryType,
  SystemRoleUpdateType
} from '@/type/system.role'

export const systemRoleList = (data:SystemRoleListQueryType) => http.post<{
  list: SystemRoleListItemType[]
  current: number
  pageSize: number
  total: number
}>("system/role/list", data)

export const systemRoleAdd = (data:SystemRoleAddType) => http.post("system/role/add", data)

export const systemRoleDelete = (data:{id:number}) => http.delete("system/role/delete", data)

export const systemRoleUpdate = (data:SystemRoleUpdateType) => http.put("system/role/edit", data)

export const systemRoleStatus = (data:{id:number,status:number}) => http.post("system/role/status", data)
